package com.example.rk.mapper;

import com.example.rk.entity.Admin;
import com.example.rk.entity.Job;
import com.example.rk.entity.RenKo;
import org.apache.ibatis.annotations.*;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.logging.Logger;

@Mapper
@Component
public interface JobMapper {

    @Update("update job set salary=#{salary},ebackground=#{ebackground},location=#{location},information=#{information},position=#{position},time=#{time}  where id=#{id}")
    void doEdit(Job job);
    @Select("SELECT * FROM job where id=#{id}")
    Job findByID(int id);
    @Delete("delete from job where id=#{id}")
    void deleteById(int id);
    @Select("select * from job where location=#{location} and position=#{position}")
    Job findadd(@Param("location") String location,@Param("position") String position);
    @Insert("insert into job (salary,ebackground,location,information,position,time,sid) values(#{salary},#{ebackground},#{location},#{information},#{position},#{time},#{sid})")
    void create(Job job);
    List<Job> findBySearch(String location, String position);

    int count(String code, String name);

    List<Job> findBySearchWithPage( String salary,String ebackground,String location,String information,String position,String time,int sid);
    @Select("SELECT * FROM job where sid=#{id}")
    List<Job> findonly(int id);

    List<Job>findBySearch1(int sid,String location, String position);
}
